<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<META http-equiv="content-type" content="text/html; charset=UTF-8">
<META name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<META http-equiv="content-script-type" content="text/javascript">
<META http-equiv="content-style-type" content="text/css">
<META http-equiv="cache-control" content="max-age=0" />
<META http-equiv="cache-control" content="no-cache" />
<TITLE>GeoHex.net</TITLE>
<script src="hex_v2.js" type="text/javascript" content="text/html; charset=Shift-JIS"></script>
<script type="text/javascript">
    var watchID ="";
    var key=new Array();
    var level = 16;
    var scl = 16;
    var map;
    var infowin;

    function initialize() {
  ret = '<textarea cols="60" rows="60">';

             testdata = [[0,0],
                        [-85,-180],
                        [85,180],
                        [-85,180],
                        [85,-180],
                        [40.714997,-74.00528], // NY
                        [51.49079,-0.129089], // london
                        [-33.866959,151.20728], // Sydney
                        [35.68052783324247,139.76589796295167], // 東京
                        [35.647401, 139.716911],   // 渋谷
                        [43.055248, 141.345505],   // 北海道
                        [24.340565, 124.156201],  // 沖縄
                        [85.0511188263601, 140.562289953232]];
             var zone = GeoHex.getZoneByLocation(85,180,18);

             for ( var i in testdata ){
               ll = testdata[i];
               for ( var p = 0; p < 25; p++){
                 //var zone = GeoHex.getZoneByLocation(ll[0], ll[1], p);
                 //ret = ret + "[" + ll[0] + "," + ll[1] + "," + p + "] => '" + zone.code + "',\n";
               }

             }

  ret = ret + '</textarea>';
  document.getElementById('result').innerHTML = ret;

  ret = '<textarea cols="60" rows="60">';
             testdata = ['aaa',
'aac',
'bca',
'bcg',
'bdc',
'ccd',
'ced',
'cke',
'did',
'dif',
'dui',
'eEo',
'eqh',
'esh',
'faaAn',
'faaAp',
'fbau4',
'gbam3',
'gbao1',
'gcbEa',
'hca0R',
'hcayT',
'hfcwc',
'iebQJ',
'iebQL',
'ikeIe',
'jjdK3',
'jjdK5',
'jvi0i',
'kGqSo',
'ktg6X',
'kth4b',
'laaDneV',
'laaDneX',
'lbaz6K2',
'mbas1gR',
'mbas1iR',
'mcbPe8U',
'ncaAToN',
'ncaATqL',
'nfcHjgQ',
'ofbmP47',
'ole0tmI',
'pkdzHcf',
'pwiQDy2',
'qIsXeGc',
'quhO0el',
'quhO0en',
'raaFoEQkv',
'raaFoEQkx',
'rba583BCM',
'sbax3uIy9',
'sbax3uIyB',
'sdbcjXpoC',
'tcaKXE3Gp',
'tcaKXE3Ip',
'tgcfsW54q',
'ufb7WvW25',
'ufb7WvW27',
'umelBUcUA',
'vldgVGVWf',
'vldgVGVWh',
'vyjxoRfOq',
'wMsL2LkE8',
'wwhnTzSWn',
'wwhnTzSWp',
'xaaIp0PPMW3',
'xaaIp0PPMW5',
'xbaBA9U9v2c',
'yba25RHHBWb',
'yba25RHHBWd',
'ydbpnlQkGWa'
];
  console.log(testdata)
  for ( var i in testdata ){
      var zone = GeoHex.getZoneByCode(testdata[i]);
      ret = ret + zone.code + "," + zone.lat + "," + zone.lon + ","+ zone.getLevel() + "\n";
  }
  ret = ret + '</textarea>';
  document.getElementById('result2').innerHTML = ret;

}

</script>
<style type="text/css">
    html,body{
        height:   100%;
        margin:   0px;
    }
    #copy a:link { color: #ffffff; }
    #copy a:visited { color: #ffffff; }
    #copy a:hover { color: #ffffff; }
    #copy a:active { color: #ffffff; }

@-webkit-keyframes mycolor {

	0%	{
                right:100%;
		}
	100%	{
                right:0;
		}

	}
#level_r{
  float:right;
  margin:5px;
  font-size:11px;
}

</style>

</head>

<body onload="initialize()">
    <div style="width:100%;background-color:#cdcdcd;">

    <div ><div id="level_r"></div><div style="margin-left:100px;"></div></div></div>
    <div id="map_canvas" style="width: 100%;"></div>
    <h2>latlng2geohex</h2>
    <div id="result" style="width: 100%;"></div>

    <h2>geohex2latlng</h2>
<div id="result2">
</div>
    
    <h2>loc2xy</h2>
<div id="result3">
</div>


</body>
</html>
